/**
 * 交易实体文件
 */

import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity('trade')
export class TradeEntity {
  // 列字段
  @PrimaryGeneratedColumn()
  id: number;

  @CreateDateColumn()
  createdTime: Date;

  @UpdateDateColumn()
  updatedTime: Date;

  @Column({ comment: 'openid', nullable: true })
  openid: string;

  @Column({ comment: '交易地址' })
  address: string;

  @Column({ comment: '交易说明' })
  message: string;

  @Column({ comment: '联系方式' })
  contact: string;

  @Column({ comment: '经度' })
  lng: string;

  @Column({ comment: '纬度' })
  lat: string;

  @Column({ comment: '交易类型: 1 - 买 2 - 卖', default: 1 })
  type: number;
}
